<?php if ( $pfcid != PerfilComportamental::Empresa and (isset($candidato)) ):
        $dadosHistoricoSgc = $candidato->getHistoricoSgc($vaga->vagaid); ?>
<fieldset>
	<legend>Movimentações Anteriores no SGC</legend>
	<?php 
	    $total = pg_num_rows($dadosHistoricoSgc);
        if ( $total > 0 ):
    ?>
    <div class="gridPanel">
        <table class="grid" border="0">
        	<thead>
        		<tr>
            		<th>Contrato</th>
            		<th>No. Contrato</th>
            		<th>No. Aditivo</th>
            		<th>Vaga</th>
            		<th>Órgão</th>
            		<th>Terceirizada</th>
            		<th>Cargo</th>
            		<th>Lotação</th>
            		<th>Dt. Vinculação</th>
            		<th>Dt. Desvinculação</th>
            		<th>Status</th>
            		<th>Dt. Registro</th>
        		</tr>
        	</thead>
        	<tbody>
        <?php   while ( $row = pg_fetch_object($dadosHistoricoSgc)): ?>
    	      	<tr <?php if ($i++%2) echo 'class="odd"' ?>>        		
            		<td><?php echo $row->contratoid ?></td>		
            		<td><?php echo $row->numeroorgao ?></td>
            		<td><?php echo $row->numeroaditivo ?></td>		
            		<td><?php echo $row->vagaid ?></td>		
            		<td><?php echo $row->orgao ?></td>		
            		<td><?php echo $row->empresa ?></td>	
            		<td><?php echo $row->cargo ?></td>	
            		<td><?php echo $row->lotacao ?></td>		
            		<td><?php echo TUtils::DataEnPt( $row->admissao ) ?></td>		
            		<td><?php echo TUtils::DataEnPt( $row->demissao ) ?></td> 
            		<td><?php echo $row->statuscandidato ?></td>
            		<td><?php echo TUtils::DataEnPt( $row->data ) ?></td>    	
            	</tr>	
    	<?php endwhile;?>
    		</tbody>
    	</table>
	</div>
	<?php else:?>
	<p>Não foram encontrados dados na base de dados do SGC para este candidato.</p>
	<?php endif; ?>
</fieldset>
<?php endif; ?>